<!DOCTYPE html>

<html class="app-ui">

	<head>
		<!-- Meta -->
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

		<!-- Document title -->
		<title>万邦-云阅卷</title>

		<meta name="description" content="AppUI - Admin Dashboard Template & UI Framework" />
		<meta name="author" content="rustheme" />
		<meta name="robots" content="noindex, nofollow" />

		<!-- Favicons -->
		<link rel="apple-touch-icon" href="assets/img/favicons/apple-touch-icon.png" />
		<link rel="icon" href="assets/img/favicons/favicon.ico" />

		<!-- Google fonts -->
		<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,400italic,500,900%7CRoboto+Slab:300,400%7CRoboto+Mono:400" />

		<!-- Page JS Plugins CSS -->
		<link rel="stylesheet" href="assets/js/plugins/slick/slick.min.css" />
		<link rel="stylesheet" href="assets/js/plugins/slick/slick-theme.min.css" />

		<!-- AppUI CSS stylesheets -->
		<link rel="stylesheet" id="css-font-awesome" href="assets/css/font-awesome.css" />
		<link rel="stylesheet" id="css-ionicons" href="assets/css/ionicons.css" />
		<link rel="stylesheet" id="css-bootstrap" href="assets/css/bootstrap.css" />
		<link rel="stylesheet" id="css-app" href="assets/css/app.css" />
		<link rel="stylesheet" id="css-app-custom" href="assets/css/app-custom.css" />
		<!-- End Stylesheets -->
	</head>

	<body class="app-ui layout-has-drawer layout-has-fixed-header">
		<div class="app-layout-canvas">
			<div class="app-layout-container">

				<!-- Drawer -->
				<aside class="app-layout-drawer">

					<!-- Drawer scroll area -->
					<div class="app-layout-drawer-scroll">
						<!-- Drawer logo -->
						<div id="logo" class="drawer-header">
							<a href="index.html">
								<h4 style=" text-align:center">云阅卷</h4>
							</a>
						</div>

						<!-- Drawer navigation -->
						<nav class="drawer-main">
							<ul class="nav nav-drawer">


								<li class="nav-item nav-drawer-header">菜单导航</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-calculator-outline"></i>考试管理</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="examList.html">考试列表</a>
										</li>

										<li>
											<a href="createExam.html">创建考试</a>
										</li>
									</ul>
								</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-compose-outline"></i> 在线阅卷</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="examSetting.html">阅卷设置</a>
										</li>

										<li>
											<a href="examPapers.html">我要阅卷</a>
										</li>

										<li>
											<a href="examProblemPapers.html">问题卷处理</a>
										</li>
										<li>
											<a href="examProgress.html">进度监控</a>
										</li>

										<li>
											<a href="examQuality.html">质量抽查</a>
										</li>

									</ul>
								</li>


								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-list-outline"></i> 成绩管理</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="examReport.html">考试成绩单</a>
										</li>

										<li>
											<a href="examSubReport.html">单科试题得分表</a>
										</li>

										<li>
											<a href="gradeAnalyze.html">年纪成绩分析</a>
										</li>

										<li>
											<a href="classAnalyze.html">班级成绩分析</a>
										</li>

									</ul>
								</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-ios-browsers-outline"></i> 教师讲卷</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="scoreAndPapers.html">成绩与答卷</a>
										</li>

										<li>
											<a href="highScoreComposition.html">高分作文</a>
										</li>

										<li>
											<a href="topicScore.html">试题得分情况</a>
										</li>

										<li>
											<a href="subAnalyzeReport.html">学科分析报表</a>
										</li>
									</ul>
								</li>

								<li class="nav-item nav-item-has-subnav">
									<a href="javascript:void(0)"><i class="ion-social-javascript-outline"></i> 用户中心</a>
									<ul class="nav nav-subnav">

										<li>
											<a href="schoolManager.html">学校管理</a>
										</li>

										<li>
											<a href="subManager.html">学科管理</a>
										</li>

										<li>
											<a href="gradeManager.html">年级管理</a>
										</li>

										<li>
											<a href="gradeAndSubManager.html">年级与学科关系维护</a>
										</li>

										<li>
											<a href="teaManager.html">教师管理</a>
										</li>

										<li>
											<a href="classManager.html">班级管理</a>
										</li>

										<li>
											<a href="stuManager.html">学生管理</a>
										</li>

										<li>
											<a href="subAdnClassAnager.html">学科与班级关系维护</a>
										</li>
									</ul>
								</li>

							</ul>
						</nav>
						<!-- End drawer navigation -->

						<div class="drawer-footer">
							<p class="copyright">Copyright &copy; 2020.北京万邦易嵌科技有限公司.<a target="_blank" href="http://www.wanbangee.com">万邦易嵌</a></p>
						</div>
					</div>
					<!-- End drawer scroll area -->
				</aside>
				<!-- End drawer -->

				<!-- Header -->
				<header class="app-layout-header">
					<nav class="navbar navbar-default">
						<div class="container-fluid">
							<div class="navbar-header">
								<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-navbar-collapse"
								 aria-expanded="false">
									<span class="sr-only">Toggle navigation</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
								<button class="pull-left hidden-lg hidden-md navbar-toggle" type="button" data-toggle="layout" data-action="sidebar_toggle">
									<span class="sr-only">Toggle drawer</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
								<span class="navbar-page-title">

									Dashboard
								</span>
							</div>

							<div class="collapse navbar-collapse" id="header-navbar-collapse">
								<!-- Header search form -->
								<form class="navbar-form navbar-left app-search-form" role="search">
									<div class="form-group">
										<div class="input-group">
											<input class="form-control" type="search" id="search-input" placeholder="Search..." />
											<span class="input-group-btn">
												<button class="btn" type="button"><i class="ion-ios-search-strong"></i></button>
											</span>
										</div>
									</div>
								</form>

								<ul id="main-menu" class="nav navbar-nav navbar-left">
									<li class="dropdown">
										<a href="#" data-toggle="dropdown">English <span class="caret"></span></a>

										<ul class="dropdown-menu">
											<li><a href="javascript:void(0)">French</a></li>
											<li><a href="javascript:void(0)">German</a></li>
											<li><a href="javascript:void(0)">Italian</a></li>
										</ul>
									</li>
									<li class="dropdown">
										<a href="#" data-toggle="dropdown">Pages <span class="caret"></span></a>

										<ul class="dropdown-menu">
											<li><a href="javascript:void(0)">Analytics</a></li>
											<li><a href="javascript:void(0)">Visits</a></li>
											<li><a href="javascript:void(0)">Changelog</a></li>
										</ul>
									</li>
								</ul>
								<!-- .navbar-left -->

								<ul class="nav navbar-nav navbar-right navbar-toolbar hidden-sm hidden-xs">
									<li>
										<!-- Opens the modal found at the bottom of the page -->
										<a href="javascript:void(0)" data-toggle="modal" data-target="#apps-modal"><i class="ion-grid"></i></a>
									</li>

									<li class="dropdown">
										<a href="javascript:void(0)" data-toggle="dropdown"><i class="ion-ios-bell"></i> <span class="badge">3</span></a>
										<ul class="dropdown-menu dropdown-menu-right">
											<li class="dropdown-header">Profile</li>
											<li>
												<a tabindex="-1" href="javascript:void(0)"><span class="badge pull-right">3</span> News </a>
											</li>
											<li>
												<a tabindex="-1" href="javascript:void(0)"><span class="badge pull-right">1</span> Messages </a>
											</li>
											<li class="divider"></li>
											<li class="dropdown-header">More</li>
											<li>
												<a tabindex="-1" href="javascript:void(0)">Edit Profile..</a>
											</li>
										</ul>
									</li>

									<li class="dropdown dropdown-profile">
										<a href="javascript:void(0)" data-toggle="dropdown">
											<span class="m-r-sm">John Doe <span class="caret"></span></span>
											<img class="img-avatar img-avatar-48" src="assets/img/avatars/avatar3.jpg" alt="User profile pic" />
										</a>
										<ul class="dropdown-menu dropdown-menu-right">
											<li class="dropdown-header">
												Pages
											</li>
											<li>
												<a href="base_pages_profile.html">Profile</a>
											</li>
											<li>
												<a href="base_pages_profile.html"><span class="badge badge-success pull-right">3</span> Blog</a>
											</li>
											<li>
												<a href="frontend_login_signup.html">Logout</a>
											</li>
										</ul>
									</li>
								</ul>
								<!-- .navbar-right -->
							</div>
						</div>
						<!-- .container-fluid -->
					</nav>
					<!-- .navbar-default -->
				</header>
				<!-- End header -->

				<main class="app-layout-content">

					<div class="">
						<div class="row">

							<!-- .col-sm-5 -->

							<div class="col-sm-12 col-lg-12">
								<!-- Message List -->
								<div class="card">
									<div class="card-header">
										<div class="h5">质量监控</div>

									</div>
									<div class="card-block row" id="select-parent">


										<!-- DataTables init on table by adding .js-dataTable-full class, functionality initialized in js/pages/base_tables_datatables.js -->
										<div class="dropdown col-md-4">
											选择考试：
											<button class="btn btn-default dropdown-toggle " type="button" id="dropdownMenu1" data-toggle="dropdown"
											 aria-haspopup="true" aria-expanded="true">
												<span class="btn-examNm">考试名称</span>
												<span class="caret"></span>
											</button>
											<ul class="dropdown-menu dropdown-examNm" id="dropdown-examNm" aria-labelledby="dropdownMenu1">

											</ul>
										</div>
										<div class="dropdown col-md-4">
											选择科目：
											<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"
											 aria-haspopup="true" aria-expanded="true">
												<span class="btn-subNm">科目名称</span>
												<span class="caret"></span>
											</button>
											<ul class="dropdown-menu dropdown-subNm" id="dropdown-subNm" aria-labelledby="dropdownMenu1">

											</ul>
										</div>
										<div class="dropdown col-md-4">

										</div>

										<div class="dropdown col-md-4">
											选择题目：
											<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu3" data-toggle="dropdown"
											 aria-haspopup="true" aria-expanded="true">
												<span class="btn-topicNo">题目</span>
												<span class="caret"></span>
											</button>
											<ul class="dropdown-menu dropdown-topicNo" id="dropdown-topicNo" aria-labelledby="dropdownMenu1">

											</ul>
										</div>
										<div class="dropdown col-md-4">

										</div>




									</div>
									<!-- .card-block -->
								</div>
								<!-- .card -->
								<!-- End Message List -->
							</div>
							<!-- .col-sm-7 -->
						</div>
						<!-- .row -->
					</div>

					<div class="">
						<div class="row">

							<div class="col-sm-12 col-lg-12" >
								<!-- Message List -->
								
									<div class="bar-chart" style="width:100% !important;height:600px!important;float:left;posttion:relative;background: white;">
										<h5 class="bar-title">
											<label>题组：<span class="span-topicNo"></span></label>
											<label>分值：<span class="span-score"></span></label>
											<label>    全体<span>    </span></label>
											<label>最高分：<span class="span-max"></span> / </label>
											<label>最低分：<span class="span-min"></span> / </label>
											<label>平均分：<span class="span-avg"></span> / </label>
										</h5>
										<div id="show_charts" style="width:100%; height:500px; margin:80px 0 80px 0;"></div>
									</div>
								
								<!-- .card -->
								<!-- End Message List -->
							</div>
							<!-- .col-sm-7 -->
						</div>
						<!-- .row -->
					</div>

					<div class="" style="margin-top:20px;">
						<div class="row">

							<div class="col-sm-12 col-lg-12" >
								<!-- Message List -->
								<div class="card">
									<div class="card-header">
										<h4>阅卷人的评分列表</h4>
										<div class="card-actions">

										</div>
									</div>
									<div class="card-block">
										<table class="table table-hover">
											<thead>
												<tr>
													<th class="text-center" style="width: 100px;">阅卷人</th>
													<th>阅卷进度</th>
													<th>满分卷</th>
													<th>零分卷</th>
													<th>问题卷</th>
													<th>最高分</th>
													<th>最低分</th>
													<th>平均分</th>
													<th>打回重评数</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody class="quality-list">



											</tbody>
										</table>
									</div>
									<!-- .card-block -->
								</div>
								<!-- .card -->
								<!-- End Message List -->
							</div>
							<!-- .col-sm-7 -->
						</div>
						<!-- .row -->
					</div>





				</main>

			</div>
			<!-- .app-layout-container -->
		</div>
		<!-- .app-layout-canvas -->

		<!-- Apps Modal -->
		<!-- Opens from the button in the header -->

		<!-- End Apps Modal -->



		<!-- AppUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock and App.js -->
		<script src="assets/js/core/jquery.min.js"></script>
		<script src="assets/js/core/bootstrap.min.js"></script>
		<script src="assets/js/core/jquery.slimscroll.min.js"></script>
		<script src="assets/js/core/jquery.scrollLock.min.js"></script>
		<script src="assets/js/core/jquery.placeholder.min.js"></script>
		<script src="assets/js/app.js"></script>
		<script src="assets/js/app-custom.js"></script>

		<!-- Page Plugins -->

		<script src="assets/js/plugins/slick/slick.min.js"></script>
		<script src="assets/js/echarts.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.pie.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.stack.min.js"></script>
		<script src="assets/js/plugins/flot/jquery.flot.resize.min.js"></script>

		<!-- Page JS Code -->
		<!-- <script src="assets/js/pages/index.js"></script> -->
		<script>
			var schId = 1;
			var teaId = 3;
			var examId_quality = null;
			var examSubId_quality = null;
			var examNm_quality = null;
			var examSubNm_quality = null;
			var examAllInfo = null;
			var examTopicNo_quality = null;
			var scoreType_quality = null;
			var examChartInfo = null;
			var sScores = null;
			var nowIndex = -1;
			var examSubIndex = -1;

			//selectExamTeaInfo/{markerId}/{order}/{examId}/{examSubId}/{topicNo}
			//抽查按钮跳转
			function qualityCheck() {
				$('.quality-list').delegate(".btn-check", "click", function() {
					if($(this).attr("data-count")==0){
						alert("该组还未评卷")
						return ;
					}
					
					sessionStorage.setItem("qualityInfoExamId", examId_quality);
					sessionStorage.setItem("qualityInfoExamSubId", examSubId_quality);
					sessionStorage.setItem("qualityInfoMakerId", $(this).attr("data-id"));
					sessionStorage.setItem("qualityInfoTopicNo", $(this).attr("data-topicno"));
					
					window.location.href = "./qualityInfo.html?examId="+examId_quality+"&examSubId="+examSubId_quality+"&markerId="+$(this).attr("data-id")+"&topicNo="+$(this).attr("data-topicno");
					//console.log(111);
				});
			}

			//列表显示
			function strList(data) {
				var str = "";

				for (var i = 0; i < data.length; i++) {
					str += '<tr>';
					if (data[i].scoreType == 1) {
						str += '<td class="text-center">' + data[i].teaNm1 + '</td>';
					} else {
						str += '<td class="text-center">' + data[i].teaNm1 + "," + data[i].teaNm2 + '</td>';
					}

					str += '<td>' + data[i].alreadyExamNum + '/' + data[i].allocationNum + '</td>';
					str += '<td >' + data[i].fullMarkExamNum + '</td>';
					str += '<td >' + data[i].zeroExamNum + '</td>'
					str += '<td >' + data[i].problemExamNum + '</td>'
					if (data[i].ammScoreMap != null) {
						str += '<td >' + data[i].ammScoreMap.maxScore + '</td>'
						str += '<td >' + data[i].ammScoreMap.minScore + '</td>'
						str += '<td >' + data[i].ammScoreMap.avgScore + '</td>'
					} else {
						str += '<td >0</td>'
						str += '<td >0</td>'
						str += '<td >0</td>'
					}

					str += '<td >' + data[i].repeatExamNum + '</td>'
					str += '<td >';
					str += '<td><button class="btn btn-check" data-id="' + data[i].markerId + '" data-topicno="' + data[i].topicNo +
						'" data-count="'+data[i].alreadyExamNum+'">抽查</button></td>';
					str += '</td>';
					str += '</tr>';
				}
				$(".quality-list").html(str)
			}

			//获取列表信息
			function getList(examId_quality, examSubId_quality, topicNo) {
				
				if (examId_quality != null && examSubId_quality != null && examTopicNo_quality != null) {
					var url = "http://localhost:6630/wanbangee/exam-score/quality/selectMExamMarkerList/" + examId_quality + "/" +
						examSubId_quality + "/" + topicNo;
					var token = sessionStorage.getItem("token")
					$.ajax({
						type: "get", //请求方式
						headers: {
							"token": token
						},
						async: true, //是否异步
						url: url,
						crossDomain: true,
						contentType: "application/x-www-form-urlencoded",
						//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
						success: function(data) {
							//请求成功处理，和本地回调完全一样
							
							if (data.code == 1001) {
								if (data.result == null) {

								} else {
									strList(data.result)
								}
							}
						},
					});
				}
			}



			/* 折线图显示 */
			function showChart(result) {
				if (result != null) {
					
					var charData = {};
					const set = new Set();
					var series = new Array();
					var l = 0;
					var xAs = new Array();
					if (result != null) {

						var topicScore = result[0].topicScore;
						//算出分数区间

						for (var i = 0; i <= topicScore; i++) {
							xAs[i] = i;
						}

						//循环人数
						var teas = new Array();
						for (var i = 0; i < result.length; i++) {
							var teacher = result[i];
							teas[i] = result[i].teaNm1;
							//遍历成绩
							var scores = {};
							scores.data = new Array();
							var k = 0;

							for (var j = 0; j < result[0].topicScore; j++) {

								if (result[i].scoreDetails[k] != null && result[i].scoreDetails.length > 0) {

									if (Math.ceil(result[i].scoreDetails[k].score1) != j) {
										scores.data[j] = 0;
									} else {
										scores.data[j] = result[i].scoreDetails[k].scoreCount;
										k++;
									}

								} else {
									scores.data[j] = 0;
								}
							}
							scores.type = 'line';
							scores.name = result[i].teaNm1;
							series[l] = scores;
							l++;



						}


					}
					var date = new Date();
					var day = date.getDate();
					var month = date.getMonth() + 1;
					var year = date.getFullYear();
					if (day < 10) {
						day = "0" + day;
					}
					if (month < 10) {
						month = "0" + month;
					}

					var dom = document.getElementById("show_charts");
					var myChart = echarts.init(dom);
					var app = {};
					option = null;
					option = {
						title: {
							text: '折线图',
							subtext: '\r\n时间：'+year+"-"+month+"-"+day+'\r\n\r\n分数：全部'
						},
						tooltip: {
							trigger: 'axis'
						},
						legend: {
							data: teas
						},
						toolbox: {
							show: true,
							feature: {
								mark: {
									show: true
								},
								//            dataView : {show: true, readOnly: false},     //数据视图按钮
								magicType: {
									show: true,
									type: ['line', 'bar']
								},
								//            restore : {show: true},       //图表右上角刷新按钮
								saveAsImage: {
									show: true
								}
							}
						},
						calculable: true,
						xAxis: [{
							type: 'category',
							boundaryGap: false,
							data: xAs,
							name: '分数段'
						}],
						yAxis: [{
							type: 'value',
							name: '答案份卷',
							axisLabel: {
								formatter: '{value}'
							}
						}],
						series: series,
					};

					;
					if (option && typeof option === "object") {
						myChart.setOption(option, true);
					}
				}else{
						var option = {};
						var dom = document.getElementById("show_charts");
						var myChart = echarts.init(dom);
						myChart.setOption(option, true);
					
				}
			}
			//考试信息显示
			function getExamInfo() {
				var date = new Date();
				var day = date.getDate();
				var month = date.getMonth() + 1;
				var year = date.getFullYear();
				if (day < 10) {
					day = "0" + day;
				}
				if (month < 10) {
					month = "0" + month;
				}
				var url = "http://localhost:6630/wanbangee/exam-score/progress/selectExamId/" + schId + "/" + year + month + day;
				$.get(url, function(data) {
					
					if (data.code == 1001) {
						strExamInfo(data.result);

					}
				});

			}
			//考试信息的字符串拼接
			function strExamInfo(data) {
				var str = "";
				for (var i = 0; i < data.length; i++) {
					var exam = data[i];
					//str += '<option data="'+ data[i].examId +'" class="item-exam">'+ exam.examNm +'</option>';
					str += '		<li><a href="#" id="item-exam" data="' + data[i].examId + '">' + exam.examNm + '</a></li>';
				}
				$(".dropdown-examNm").html(str);
			}
			//选择考试的点击事件
			function examItemClick() {


				$('#dropdown-examNm').delegate("#item-exam", "click", function() {

					var text = $(this).text();
					$(".btn-examNm").text(text);
					examId_quality = $(this).attr("data");
					examNm_quality = $(this).text();
					getExamSubInfo($(this).attr("data"));
					sessionStorage.setItem("examId_quality", examId_quality);
					sessionStorage.setItem("examNm_quality", examNm_quality);
					// if(examSubId!=null){
					// 	console.log(11)
					// 	//getTeaProgress(examId_quality_quality,examSubId_quality);
					// }
				});
			}
			//获取考试科目信息
			function getExamSubInfo(examId_quality) {
				var url = 'http://localhost:6630/wanbangee/exam-score/progress/selectMSubjectByExamId/' + examId_quality;

				var token = sessionStorage.getItem("token");
				$.ajax({
					headers: {
						"token": token
					},
					type: "get", //请求方式
					async: false, //是否异步
					contentType: "application/x-www-form-urlencoded",
					url: url,
					crossDomain: true,
					dataType: "json", //跨域json请求一定是jsonp
					//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
					success: function(data) {
						//请求成功处理，和本地回调完全一样

						if (data.code == 1001) {
							examAllInfo = data.result;
							strExamSubInfo(data.result);
						}
					},
				});
			}
			//字符串-考试科目列表
			function strExamSubInfo(data) {
				
				if(data!=null&&data.length>0){
				var str = "";
				for (var i = 0; i < data.length; i++) {
					var exam = data[i];
					str += '		<li><a href="#" id="item-examSub" index="' + i + '" data="' + data[i].examSubId + '">' + exam.subNm +
						'</a></li>';
				}
				$(".dropdown-subNm").html(str);
				//获取老师的进度信息
				}
			}
			//字符串-考试科目题号列表
			function strExamSubTopicNo(data) {
				//console.log(data)
				var str = "";
				sScores = data.sscores;
				//console.log(sScores)
				for (var i = 0; i < sScores.length; i++) {

					str += '		<li><a href="#" id="item-examTopicNo" index="' + i + '" data="' + data.examSubId + '">' + sScores[i].topicNo +
						'</a></li>';
				}
				$(".dropdown-topicNo").html(str);
				//获取老师的进度信息

			}
			//选择科目的点击事件
			function examSubItemClick() {
				$("#dropdown-subNm").delegate("#item-examSub", "click", function() {
					var text = $(this).text();
					var i = $(this).attr("index");
					//console.log(text)
					//console.log(text)
					$(".btn-subNm").text(text);
					examSubIndex = i;//当前选中的考试科目
					sessionStorage.setItem("examSubIndex",examSubIndex);
					examSubId_quality = $(this).attr("data");
					examSubNm_quality = $(this).text();
					sessionStorage.setItem("examSubId_quality", examSubId_quality);
					sessionStorage.setItem("examSubNm_quality", examSubNm_quality);
					
					strExamSubTopicNo(examAllInfo[i]);

					//获取老师的进度信息
					//if(examId!=null)
					//getTeaProgress(examId, examSubId);
				});
			}
			//选择题目的点击事件
			function chooseTopicNoClick() {
				$("#dropdown-topicNo").delegate("#item-examTopicNo", "click", function() {
					var text = $(this).text();

					examTopicNo_quality = text;
					sessionStorage.setItem("examTopicNo_quality", examTopicNo_quality);
					var i = $(this).attr("index");
					scoreType_quality = sScores[i].scoreType;
					sessionStorage.setItem("scoreType_quality",scoreType_quality);
					nowIndex = i;
					$(".btn-topicNo").text(text);
					if(isSubjectLeader(examId_quality,examSubId_quality,teaId)==true){
						getAvgMaxMin(examId_quality, examSubId_quality, sScores[i].topicNo, sScores[i].scoreType);
						getChartInfo(examId_quality, examSubId_quality, sScores[i].topicNo);
						getList(examId_quality, examSubId_quality, sScores[i].topicNo);
						
					}else{
						$(".quality-list").html("");
						showChart(null)
						//getAvgMaxMin(examId_quality, examSubId_quality, sScores[i].topicNo, sScores[i].scoreType);
						$(".span-topicNo").text("");
						$(".span-score").text("");
						$(".span-max").text(0);
						$(".span-min").text(0);
						$(".span-avg").text(0);
					}
					
					//获取老师的进度信息
					//if(examId!=null)
					//getTeaProgress(examId, examSubId);
				});
			}


			//获取整体的最高最小平均

			function getAvgMaxMin(examId, examSubId, topicNo, scoreType) {
				var url = "http://localhost:6630/wanbangee/exam-score/quality/selectAllAvgMavMin/" + examId + "/" + examSubId + "/" +
					topicNo + "/" + scoreType;
				var token = sessionStorage.getItem("token");
				$.ajax({
					headers: {
						"token": token
					},
					type: "get", //请求方式
					async: true, //是否异步
					url: url,
					crossDomain: true,
					contentType: "application/x-www-form-urlencoded",
					//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
					success: function(data) {

						if (data.code == 1001) {
							if (data.result == null) {
								$(".span-max").text(0);
								$(".span-min").text(0);
								$(".span-avg").text(0);
							} else {
								$(".span-max").text(data.result.maxScore);
								$(".span-min").text(data.result.minScore);
								$(".span-avg").text(data.result.avgScore);
							}
						}
					},
				});
			}
			//获取用于图标的信息
			function getChartInfo(examId, examSubId, topicNo) {
				if(examId!=null&&examSubId!=null&&topicNo!=null){
				var url = "http://localhost:6630/wanbangee/exam-score/quality/selectQualityCharInfo/" + examId + "/" + examSubId +
					"/" + topicNo;
				var token = sessionStorage.getItem("token");
				$.ajax({
					type: "get", //请求方式
					headers: {
						"token": token
					},
					async: true, //是否异步
					url: url,
					crossDomain: true,
					contentType: "application/x-www-form-urlencoded",
					//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
					success: function(data) {
						//请求成功处理，和本地回调完全一样
						if (data.code == 1001) {

							$(".span-topicNo").text(topicNo);
							$(".span-score").text(data.result[0].topicScore);
							examChartInfo = data.result;
							sessionStorage.setItem("examChartInfo", examChartInfo);
							showChart(data.result);
						}
					},
				});
				}
			}
			function getTeaInfo(){
				var url = "http://localhost:6630/user-center/";
			}
			
			function isSubjectLeader(examId,examSubId,teaId){
				var url = "http://localhost:6630/wanbangee/exam-score/quality/selectIsPrincipalTea/"+examId+"/"+examSubId+"/"+teaId;
				var token = sessionStorage.getItem("token");
				var flag = false;
				$.ajax({
					headers: {
						"token": token
					},
					type: "get", //请求方式
					async: false, //是否异步
					url: url,
					crossDomain: true,
					contentType: "application/x-www-form-urlencoded",
					//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
					success: function(data) {
					
						if (data.code == 1001) {
							flag = true;
						}else{
							flag = false;
						}
					},
				});
				return flag;
			}
			function testInfo(){
				var url = "http://localhost:6200/teacherManage/selectTeacher?teaId="+1;
				var token = sessionStorage.getItem("token");
				$.ajax({
					headers: {
						"token": token
					},
					type: "get",
					async: false, //是否异步
					//data:{_method:put},
					//数据，json字符串,规定连同请求发送到服务器的数据
				    //data : JSON.stringify(list),
					url: url,
					contentType: "application/x-www-form-urlencoded",
					success: function(data) {
						console.log(data);
					},
					//请求失败，包含具体的错误信息
					error: function(e) {
						console.log(e)
					}
				});
			}

			$(function() {
				examId_quality = sessionStorage.getItem("examId_quality");
				examSubId_quality = sessionStorage.getItem("examSubId_quality");
				examTopicNo_quality = sessionStorage.getItem("examTopicNo_quality");
				examNm_quality = sessionStorage.getItem("examNm_quality");
				examSubNm_quality = sessionStorage.getItem("examSubNm_quality")
				scoreType_quality = sessionStorage.getItem("scoreType_quality")
				examSubIndex = sessionStorage.getItem("examSubIndex");
				if(examId_quality!=null)
				$(".btn-examNm").text(examNm_quality)
				if(examSubId_quality!=null)
				$(".btn-subNm").text(examSubNm_quality);
				if(examTopicNo_quality!=null)
				$(".btn-topicNo").text(examTopicNo_quality);
				
				
				if(examId_quality!=null&&examSubId_quality!=null){
					if(isSubjectLeader(examId_quality,examSubId_quality,teaId)==true){
						getExamInfo();
						//获取考试科目信息
						getExamSubInfo(examId_quality);
						//获取题号信息
						if(examSubIndex!=-1)
						strExamSubTopicNo(examAllInfo[examSubIndex])
						//显示图表
						getChartInfo(examId_quality,examSubId_quality,examTopicNo_quality);
							//获取列表数据
						getList(examId_quality, examSubId_quality, examTopicNo_quality);
						getAvgMaxMin(examId_quality, examSubId_quality, examTopicNo_quality, scoreType_quality);
					}
				}
				//考试信息显示
				getExamInfo();
				
				
				
				//选择考试的点击时间
				examItemClick();
				//选择科目的点击事件
				examSubItemClick();
				//题号点击事件
				chooseTopicNoClick();
			
				//getList();
				//抽查按钮跳转
				qualityCheck();


			});
		</script>

	</body>

</html>
